package com.gaojiabao.panghu.exception;

import com.gaojiabao.panghu.constant.ResultCodeEnum;
import com.gaojiabao.panghu.utils.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author: gaojiabao
 * @Date: 2024/11/4 14:18
 * @Describe 全局异常类
 */
@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(Exception.class)
    public Object handlerException(Exception e){
        e.printStackTrace();
        return Result.build(null, ResultCodeEnum.SERVER_ERROR);
    }
}
